var containsNearbyAlmostDuplicate = function(arr, k, t) {
    if (k === 0) {
        return true
    }
    arr.sort((a, b) => a - b)
    arr.forEach((item, index) => {
        if (arr[index + 1] - item <= t)
    });
    return false
};

console.log(containsNearbyAlmostDuplicate([1, 5, 9, 1, 5, 9], 2, 3))